const px2rem = require('postcss-px2rem')
const postcss = px2rem({
  // 基准大小 baseSize，需要和rem.js中相同
  remUnit: 16
})
module.exports = {
  lintOnSave: true,
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          postcss
        ]
      },
      scss: {
        prependData: `@import "~@/styles/mixins.scss";`
      }
    }
  },
  devServer: {
    open: true, // 浏览器自动打开页面
    proxy: {
      api: {
        target: 'http://192.168.0.122:8035',
        changeOrigin: true, // 是否跨域，设置为true;(必须)
        pathRewrite: {
          '^/api': '' // 需要rewrite的,
        }
      }
    }
  },
  publicPath: './',
  outputDir: 'cxxy'
}
